package dhcpha.clinical.adapter;
import java.util.List;
import android.content.Context;
import android.text.SpannableString;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import dhcpha.clinical.activity.R;

public class CtLocAdapter extends BaseAdapter{

    private Context context;
    private List<SpannableString> carList;
    
    public CtLocAdapter(Context context, List<SpannableString> carList) {
        super();
        this.context = context;
        this.carList = carList;
    }

    @Override
    public int getCount() {
        // TODO Auto-generated method stub
        return carList.size();
    }

    @Override
    public Object getItem(int arg0) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public long getItemId(int arg0) {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public View getView(int arg0, View arg1, ViewGroup arg2) {
        // TODO Auto-generated method stub
        ViewHoler holer = null;
        if(arg1 == null) {
            holer = new ViewHoler();
            arg1 = View.inflate(context, R.layout.item_droploc_listview, null);
            holer.tv_name = (TextView)arg1.findViewById(R.id.loc_item_text);
            arg1.setTag(holer);
        }else {
            holer = (ViewHoler)arg1.getTag();
        }
        holer.tv_name.setText(carList.get(arg0));
        return arg1;
    }
    class ViewHoler{
        private TextView tv_name;
    }


}
